

public class wode {
public static void main(String[] args){
    Runnable printA = new PrintGreet("你好", 50);
    Runnable printB = new Stnf("20001", "大飞");
    Runnable print100 = new PrintGreet("再见",50);
    Thread thread1 = new Thread(printA);
    Thread thread2 = new Thread(printB);
    Thread thread3 = new Thread(print100);
    thread1.start();
    thread2.start();
    thread3.start();
}

}
class PrintGreet implements Runnable{
        private String greet;
        private int frequency;
        public PrintGreet(String greet,int frequency){
            this.greet = greet;
            this.frequency = frequency;}
        @Override
        public void run() {
            for (int i=0;i<=frequency;i++){
                System.out.print(greet);
            }}}
 class Stnf implements Runnable{
    public Stnf(String id, String name) {
        this.id = id;
        this.name = name;
    }
    private String id;
    private String name;
    @Override
    public void run() {
        System.out.print(id+name);
    }
}
